Add a prefer-top-level-if-only-type-imports option for the consistent-type-specifier-style rule#3210
Conversation
…e-specifier-style rule
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3210 +/- ##
===========================================
+ Coverage 82.25% 95.50% +13.24%
===========================================
Files 94 83 -11
Lines 4283 3692 -591
Branches 1478 1334 -144
===========================================
+ Hits 3523 3526 +3
+ Misses 760 166 -594 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
FWIW, I think you can achieve something similar to this today via the following cocktail of rules:
With that said, it may still be useful to have this combined behavior available under a single rule. P.S. for strictness in usage of |
Adds a
prefer-top-level-if-only-type-importsoption for theconsistent-type-specifier-stylerule. See docs. This is useful when you generally prefer inline but you are using TypeScriptverbatimModuleSyntaxand want all-type imports to be omitted by bundlers.